home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-09 | 7.3 KB | 135 lines | [TEXT/KAHL] |
- // ****************************************************************************
- //
- // Bolo standard Autopilot Brain
- // (C) 1993 Stuart Cheshire <cheshire@cs.stanford.edu>
- // I make no claims that this is good code. It is provided solely as
- // simple example code to assist in writing Bolo plug-in Brain modules.
- // I do not have the time to tidy it up and make it elegant at all, so
- // if you have ever been a student of mine and lost marks for bad style,
- // don't even think of trying to use this code to justify claiming extra
- // marks. It is crap. And it uses far too many global variables.
- //
- // ****************************************************************************
-
- // ****************************************************************************
- //
- // Bolo non-standard Autopilot Brain
- // Modified by Milo Sharp <fxmcs@aurora.alaska.edu>
- // I will make many claims that this is not good code. It is provided
- // solely as an alternative to the standard brain. I do not program in
- // C, so if I ever let you look at the code, you would probably cringe in
- // horror. I do. And it STILL uses far too many global variables.
- //
- // ****************************************************************************
-
-
- Changes I've made to the brain:
-
- New options:
-
- Roam - This used to be a part of the 'Aggressive' function. However, I
- thought it was stupid that a non-aggressive brain would just sit and rot.
- To me, non-aggressiveness means you won't embroil yourself in fights - not
- that you don't have any motivation. A roaming tank will avoid fights with
- other tanks and will not attack pillboxes. Bases are still fair game, as
- are builders. (see Murderous)
-
- Aggressive - Due to the addition of the Roam function, this has no control
- over what your tank will do UNLESS he is within sight of an enemy tank or
- pillbox. With Roam unchecked and Aggressive checked, your tank will sit
- in one spot, but chase after any enemy tanks that come into view.
-
- Drop Only Near Bases - The standard bolo brain would just place a pillbox
- whereever he picked one up. This didn't make for a tough offense against
- them - they would leave their bases unprotected and scatter pillboxes around
- the map randomly. Now, with this option checked, the brain will carry any
- pillboxes it has picked up with it until it reaches a base. Once upon a
- base, the brain will place a pillbox one square behind itself. It's still
- pretty mindless, but I've seen brains build some decent forts this way -
- I've stumbled upon bases with two or three pills surrounding it before.
-
- Murderous - The old brain took no notice of builders whatsoever. This made
- it simple to have your builder sneak up behind it and drop a pillbox,
- which would take upon itself the duty of pulverising the brain. Now the
- tank will make a concerted effort to blow the builder to smithereens.
- Unfortunately, this rarely works, as the builder generally moves much too
- fast for the poor brain to catch it. However, other brains, at least,
- have the tendency to leave their builders stranded amongst some buildings
- or rivers, and this has some use if a Murderous brain happens upon a lost
- builder.
-
- Disabled options:
-
- Build Fortresses - This will more or less work, but is still buggy, so I
- decided to leave it out. Anyone with some skill in ResEdit could easily
- re-enable it, so here's what it does: similar to the Place Only Near
- Bases (in fact, it requires that option enabled to work), Build Forts
- tries to make brains work harder at defending the bases they've worked so
- hard at capturing. When a fort-building brain captures a pillbox, they
- will proceed toward any friendly base they can find immediately, whereas
- a brain with only the Place near Bases option on waits until they decide
- they NEED to return to the base (which is sometimes too late). The main
- problem with this is that on occasion the brain will get stuck in a loop,
- as with the case of a base surrounded by four pillboxes. Since the tank
- can't slip between them, he'll blast his way out. Moving forward, he picks
- up the defenseless pillbox. Then, realizing he must build a fort with it,
- he'll turn around, move onto the base, drop the pillbox behind himself,
- and once more be trapped.
-
- Repair Pillboxes - This should work, with one exception. There is no
- build mode available to brains for repairing pillboxes. The closest is
- BUILDMODE_PBOX, which requires you be carrying a pill, and if you use
- that, it'll tell you "You cannot place a pillbox there". Looks like this
- feature waits on Stuart, until he implements that.
-
-
- Making the brain a leetle bit smarter:
-
- I tried to modify the brain's behavior a little bit, since I found it had
- some incredible moronic habits. Here's a small list of eccentricities:
-
- Attacked pillboxes while in deep water on a boat
- Preferred the head-on-with-guns-blazing-until-a-immense-wave-of-shells-
- washed-over-the-tank,causing-instant-death method of pillbox fighting
- Would wade into battle carrying a pillbox, where most real players would
- be more cautious with a valuable asset like an unplaced pill
- Would attack other tanks EVEN while wounded and hiding in the forest
-
- I've tried to fix all of these. While still not as bright as it could be,
- and far from a human opponent, it performs obviously better. I've seen it
- take two pillboxes at the start of the game without being killed. It
- still likes the head on approach, but when there are more shells coming at
- him than he has armor, he'll turn tail and run (usually) which (usually)
- winds up saving his butt. This works best if there's a base nearby he can
- use to repair his armor.
-
- He won't attack pillboxes will in a boat, which saves him from both slow
- loss of ammo and instant death. He'll try to runaway from enemy tanks
- when he is trundling around with a pillbox, and will definitely shy away
- from pillboxes. And if he's down to his last points of armor, he develops
- an affinity for the forest and avoids the open road, giving him the
- cloaking advantage that many human players are fond of.
-
- Still and all, I've seen my brain make its' fair share of blunders. He's
- trying to burrow his way into a wall right now. But this is at least a
- slight improvement, which makes playing with computers a bit more fun.
-
- About this brain:
-
- I did NOT write the original code for this brain. That honor goes to Stuart
- Cheshire, the author of Bolo. I've only modified it to improve performance.
- Why, you might ask, didn't I just make my own? Well, for all Stuart's remarks
- about the shoddiness of the code, it's actually pretty good. Better than I
- would have done, since I don't understand Bolo as well as Stuart (but then,
- who does?). And the best reason of all, I don't know how to program in C.
- All the programming I did came from a basic knowledge of programming (from
- Pascal experience) and looking at Stuart's code for syntax examples.
-
- I hope you get some use out of this brain. I've found it to outperform both
- Stuart's original Standard Autopilot and the Independent Brain 0.9, which are
- the only two brains I've been able to find that will work with Bolo 0.99.1.
- Let me know what you think of it, and what you would like changed about it.
-
-
- Milo
- <fxmcs@aurora.alaska.edu>